package com.infore.remoteControl.outsideInterface.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.remoteControl.outsideInterface.service.IOutsideService;
import com.infore.remoteControl.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 外部接口调用控制器
 * @author Cold
 *
 */
@Api(value = "外部接口调用控制器", tags = {"外部接口调用控制器" })
@RestController
@RequestMapping("/outside")
public class OutsideController {
	
	@Autowired
	IOutsideService iOutsideService;
	
	@ApiOperation(value = "根据协议数据ID查询协议")
	@ResponseBody
	@RequestMapping(value = "/protocolDataIds", method = RequestMethod.GET)
	public ResultEntity getProtocol(@RequestParam("protocolDataIds") List<String> protocolDataIds) {
		return iOutsideService.getProtocol(protocolDataIds);
	}
	
	@ApiOperation(value = "根据设备ID查询指令")
	@ResponseBody
	@RequestMapping(value = "/equipmentIds", method = RequestMethod.GET)
	public ResultEntity getInstructions(@RequestParam("equipmentIds") List<String> equipmentIds) {
		return iOutsideService.getInstructions(equipmentIds);
	}
}
